//
//  BMPhotoIO_iOS7Tool.h
//  bigmama
//
//  Created by huyuchen on 2017/9/28.
//  Copyright © 2017年 盛成文化. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import "BMPhotoIOPhotoModel.h"
#import "BMPhotoIOAlbumModel.h"
#import "BMPhotoIOVideoModel.h"
//#import "NSDate+DP.h"

@interface BMPhotoIO_iOS7Tool : NSObject

/**
 *  检查授权
 *
 *  @param authedBlock             已授权回调block
 *  @param deniedBlock             授权拒绝回调block
 */
- (void)checkAuthWithAuthedStatus:(void(^)(ALAuthorizationStatus status))authedBlock denied:(void(^)(ALAuthorizationStatus status))deniedBlock;

#pragma mark - 查询
/**
 *  查询所有相册
 *
 *  @param finishBlock             读取完毕调用block，object为 BBPhotoAlbumModel_lib 相册类型对象
 */
- (void)selectAlbumsWithFinishBlock:(void (^)(id obj))finishBlock;


/**
 查询所有包含视频的相册
 
 @param finishBlock 成功回调
 */
- (void)selectVideoAlbumsWithFinishBlock:(void (^)(id obj))finishBlock;

/**
 *  根据相册查询图片
 *
 *  @param group                   相册
 *  @param finishBlock             读取完毕调用block，object为 BBPhotoModel_lib 照片类型对象
 */
- (void)selectPhotosWithAssetGroup:(ALAssetsGroup *)group finishBlcok:(void (^)(id obj1, id obj2))finishBlock;


/**
 根据相册筛选视频
 
 @param group 相册
 @param finishBlock 读取完毕调用block，object为 BBPhotoModel_lib 照片类型对象
 */
- (void)selectVideoWithAssetGroup:(ALAssetsGroup *)group finishBlock:(void (^)(id obj1, id obj2))finishBlock;

/**
 *  根据asset获取原图
 *
 *  @param asset                   ALAsset图片对象
 */
- (UIImage *)originalImageWithAsset:(ALAsset *)asset;

#pragma mark - 保存
- (void)saveImage:(UIImage *)image metadata:(NSDictionary *)metadata finishedBlock:(void (^)(id obj))finishedBlock;

@end
